import request from '@/utils/request'

// 查询客户列表
export function getCustomerList(query) {
    return request({
        url: '/customer/customer/list',
        method: 'get',
        params: query
    })
}

// 查询客户统计
export function customerStatistics(query) {
    return request({
        url: '/customer/customer/statistics',
        method: 'get',
        params: query
    })
}

// 客户新增
export function customerAdd(data) {
    return request({
        url: '/customer/customer',
        method: 'post',
        data: data
    })
}

// 客户编辑
export function customerUpdate(data) {
    return request({
        url: '/customer/customer',
        method: 'put',
        data: data
    })
}

// 客户新增
export function customerDetail(customerId) {
    return request({
        url: `/customer/customer/${customerId}`,
        method: 'get'
    })
}

// 客户删除
export function customerDelete(customerIds) {
    return request({
        url: `/customer/customer/${customerIds}`,
        method: 'delete'
    })
}

// 获取客户额度共用设置
export function quotaSharingSet(data) {
    return request({
        url: `/customer/quotaSharing`,
        method: 'put',
        data: data
    })
}

// 查询客户额度共用列表
export function quotaSharingList(query) {
    return request({
        url: '/customer/quotaSharing/list',
        method: 'get',
        params: query
    })
}

// 新增或修改客户额度
export function quotaSharingAdd(data) {
    return request({
        url: `/customer/quotaSharing/addOrUpdate`,
        method: 'put',
        data: data
    })
}

// 删除客户额度共用
export function quotaSharingDelete(quotaSharingIds) {
    return request({
        url: `/customer/quotaSharing/${quotaSharingIds}`,
        method: 'delete'
    })
}

// 获取客户额度共用设置
export function quotaSharing(customerId) {
    return request({
        url: `/customer/quotaSharing/${customerId}`,
        method: 'get'
    })
}

// 获取客户开票设置
export function customerInvoice(customerId) {
    return request({
        url: `/customer/invoice/${customerId}`,
        method: 'get'
    })
}

// 客户开票设置
export function customerInvoiceSet(data) {
    return request({
        url: `/customer/invoice`,
        method: 'put',
        data: data
    })
}

// 查询客户字典列表
export function customerDictList(query) {
    return request({
        url: '/system/dict/data/getCustomerDictList',
        method: 'get',
        params: query
    })
}

// 获取客户字典详细信息
export function customerDictDetail(customerDictId) {
    return request({
        url: `/system/dict/data/getCustomerDictInfo/${customerDictId}`,
        method: 'get',
        params: query
    })
}

// 查询信审记录列表 无分页
export function creditReviewAllDetails(query) {
    return request({
        url: `/creditReview/creditReview/allDetails`,
        method: 'get',
        params: query
    })
}

// 新增客户字典
export function customerDictAdd(data) {
    return request({
        url: '/system/dict/data/addCustomerDict',
        method: 'post',
        data: data
    })
}

// 修改客户字典
export function customerDictEdit(data) {
    return request({
        url: '/system/dict/data/updateCustomerDict',
        method: 'post',
        data: data
    })
}

// 删除客户字典
export function customerDictDelete(customerDictIds) {
    return request({
        url: `/system/dict/data/removeCustomerDict/${customerDictIds}`,
        method: 'delete'
    })
}

// 查询客户买受人关联列表
export function vendeeList(query) {
    return request({
        url: '/customerCorrelationVendee/list',
        method: 'get',
        params: query
    })
}

// 获取客户买受人关联详细信息
export function customerCorrelationVendee(correlationVendeeId) {
    return request({
        url: `/customerCorrelationVendee/${correlationVendeeId}`,
        method: 'get'
    })
}

// 新增客户买受人关联
export function addVendee(data) {
    return request({
        url: '/customerCorrelationVendee/addVendee',
        method: 'post',
        data: data
    })
}

// 删除客户买受人关联
export function vendeeDelete(correlationVendeeIds) {
    return request({
        url: `/customerCorrelationVendee/${correlationVendeeIds}`,
        method: 'delete'
    })
}

// 识别身份证
export function recognitionIdCard(data) {
    return request({
        url: `/customer/customer/recognition/idCard`,
        method: 'POST',
        data
    })
}


// 识别营业执照
export function recognitionBusinessLicense(ossId) {
    return request({
        url: `/customer/customer/recognition/businessLicense/${ossId}`,
        method: 'POST',
    })
}

// 识别营业执照2
export function recognitionBusinessLicense2(ossId) {
    return request({
        url: `/supplier/supplier/recognition/businessLicense/${ossId}`,
        method: 'POST',
    })
}


// 识别驾驶证
export function recognitionDrivingLicense(data) {
    return request({
        url: `/customer/customer/recognition/drivingLicense`,
        method: 'POST',
        data
    })
}

//   导入客户
export const IMPORTMEMBER =
    "/customer/customer/importCustomerData";

// 模板下载
export const CUSTOMER_EXPORT = `/system/templateFile/download/customer_export`